package com.jvm;

public class Demo1 {
	public static void main(String[] args) throws Exception {
		/*Thread.sleep(3000);
		while (true) {
			loadData();
		}*/

		int x = 4;
		System.out.println("value is " + ((x > 4) ? 99.9 : 9));

		boolean switchLog = true;
		Integer oneExpre = null;
		Integer result = switchLog ? oneExpre : 0;
		System.out.println(result);

//		boolean switchLog = true;
//		Integer oneExpre = null;
//		Integer result = switchLog ? oneExpre : new Integer(0);
//		System.out.println(result);

		ThreadLocal local = new ThreadLocal();
		local.set("name");
		local.set("age");
		System.out.println(local.get());
	}

	private static void loadData() throws Exception {
		byte[] data = null;
		for (int i = 0; i < 4; i++) {
			data = new byte[10 * 1024 * 1024];
		}
		data = null;

		byte[] data1 = new byte[10 * 1024 * 1024];
		byte[] data2 = new byte[10 * 1024 * 1024];

		byte[] data3 = new byte[10 * 1024 * 1024];
		data3 = new byte[10 * 1024 * 1024];

		Thread.sleep(1000);
	}
}
